<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Class template cached_node_allocator</title>
<link rel="stylesheet" href="../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset">
<link rel="up" href="../../interprocess/indexes_reference.html#doxygen.boost_interprocess_header_reference.cached__node__allocator_8hpp" title="Header &lt;boost/interprocess/allocators/cached_node_allocator.hpp&gt;">
<link rel="prev" href="cached__adaptive__pool_8hpp_1a8538149c5beca8c76b5925eed81e4e0d.html" title="Function template operator!=">
<link rel="next" href="structboost_1_1interprocess_1_1cached__node__allocator_1_1rebind.html" title="Struct template rebind">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../boost.png"></td>
<td align="center"><a href="../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="cached__adaptive__pool_8hpp_1a8538149c5beca8c76b5925eed81e4e0d.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../interprocess/indexes_reference.html#doxygen.boost_interprocess_header_reference.cached__node__allocator_8hpp"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="structboost_1_1interprocess_1_1cached__node__allocator_1_1rebind.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1cached__node__allocator"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Class template cached_node_allocator</span></h2>
<p>boost::interprocess::cached_node_allocator</p>
</div>
<h2 class="refsynopsisdiv-title">Synopsis</h2>
<div class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../interprocess/indexes_reference.html#doxygen.boost_interprocess_header_reference.cached__node__allocator_8hpp" title="Header &lt;boost/interprocess/allocators/cached_node_allocator.hpp&gt;">boost/interprocess/allocators/cached_node_allocator.hpp</a>&gt;

</span><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T<span class="special">,</span> <span class="keyword">typename</span> SegmentManager<span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> NodesPerBlock<span class="special">&gt;</span> 
<span class="keyword">class</span> <a class="link" href="classboost_1_1interprocess_1_1cached__node__allocator.html" title="Class template cached_node_allocator">cached_node_allocator</a> <span class="special">{</span>
<span class="keyword">public</span><span class="special">:</span>
  <span class="comment">// types</span>
  <span class="keyword">typedef</span> <span class="identifier">implementation_defined</span><span class="special">::</span><span class="identifier">segment_manager</span> <a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1cached__node__allocator_1adab9ee45284b9065aa529ccac37868da"></a><span class="identifier">segment_manager</span><span class="special">;</span>
  <span class="keyword">typedef</span> <span class="identifier">segment_manager</span><span class="special">::</span><span class="identifier">void_pointer</span>           <a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1cached__node__allocator_1a2120ddc9deb55023e3ff42e273018202"></a><span class="identifier">void_pointer</span><span class="special">;</span>   
  <span class="keyword">typedef</span> <span class="identifier">implementation_defined</span><span class="special">::</span><span class="identifier">pointer</span>         <a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1cached__node__allocator_1ac3559275d855e3768b5cf92f272693a8"></a><span class="identifier">pointer</span><span class="special">;</span>        
  <span class="keyword">typedef</span> <span class="identifier">implementation_defined</span><span class="special">::</span><span class="identifier">const_pointer</span>   <a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1cached__node__allocator_1a76099c3b6446dc11c5d4022c97f72ef7"></a><span class="identifier">const_pointer</span><span class="special">;</span>  
  <span class="keyword">typedef</span> <span class="identifier">T</span>                                       <a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1cached__node__allocator_1a28d7e86d4b86e6eb7c73d317a4e23bb1"></a><span class="identifier">value_type</span><span class="special">;</span>     
  <span class="keyword">typedef</span> <span class="emphasis"><em><span class="identifier">unspecified</span></em></span>                             <a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1cached__node__allocator_1abe665d0080b38cf409f723545013401f"></a><span class="identifier">reference</span><span class="special">;</span>      
  <span class="keyword">typedef</span> <span class="emphasis"><em><span class="identifier">unspecified</span></em></span>                             <a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1cached__node__allocator_1afd08ebc17888a4fe66e38494fc624b53"></a><span class="identifier">const_reference</span><span class="special">;</span>
  <span class="keyword">typedef</span> <span class="identifier">SegmentManager</span><span class="special">::</span><span class="identifier">size_type</span>               <a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1cached__node__allocator_1afb4ec6c58b2bdd6160e04f46ae73e0f1"></a><span class="identifier">size_type</span><span class="special">;</span>      
  <span class="keyword">typedef</span> <span class="identifier">SegmentManager</span><span class="special">::</span><span class="identifier">difference_type</span>         <a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1cached__node__allocator_1a580cdcf3bfc4f8be24b18c0916a113d5"></a><span class="identifier">difference_type</span><span class="special">;</span>

  <span class="comment">// member classes/structs/unions</span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T2<span class="special">&gt;</span> 
  <span class="keyword">struct</span> <a class="link" href="structboost_1_1interprocess_1_1cached__node__allocator_1_1rebind.html" title="Struct template rebind">rebind</a> <span class="special">{</span>
    <span class="comment">// types</span>
    <span class="keyword">typedef</span> <a class="link" href="classboost_1_1interprocess_1_1cached__node__allocator.html" title="Class template cached_node_allocator">cached_node_allocator</a><span class="special">&lt;</span> <span class="identifier">T2</span><span class="special">,</span> <span class="identifier">SegmentManager</span> <span class="special">&gt;</span> <a class="link" href="structboost_1_1interprocess_1_1cached__node__allocator_1_1rebind.html#doxygen.boost_interprocess_header_reference.structboost_1_1interprocess_1_1cached__node__allocator_1_1rebind_1a438818fbe824f6d39f8563a868fcf114"><span class="identifier">other</span></a><span class="special">;</span>
  <span class="special">}</span><span class="special">;</span>

  <span class="comment">// <a class="link" href="../boost_container_header_reference/classboost_1_1container_1_1allocator.html#id9-bb">private member functions</a></span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T2<span class="special">,</span> <span class="keyword">typename</span> SegmentManager2<span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> N2<span class="special">&gt;</span> 
    <a class="link" href="classboost_1_1interprocess_1_1cached__node__allocator.html" title="Class template cached_node_allocator">cached_node_allocator</a> <span class="special">&amp;</span> 
    <a class="link" href="classboost_1_1interprocess_1_1cached__node__allocator.html#doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1cached__node__allocator_1a4183e4e6c9610222ead88c312202f8bf"><span class="keyword">operator</span><span class="special">=</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="classboost_1_1interprocess_1_1cached__node__allocator.html" title="Class template cached_node_allocator">cached_node_allocator</a><span class="special">&lt;</span> <span class="identifier">T2</span><span class="special">,</span> <span class="identifier">SegmentManager2</span><span class="special">,</span> <span class="identifier">N2</span> <span class="special">&gt;</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <a class="link" href="classboost_1_1interprocess_1_1cached__node__allocator.html" title="Class template cached_node_allocator">cached_node_allocator</a> <span class="special">&amp;</span> <a class="link" href="classboost_1_1interprocess_1_1cached__node__allocator.html#doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1cached__node__allocator_1a948b3249fccec62371f2c488bd98da57"><span class="keyword">operator</span><span class="special">=</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="classboost_1_1interprocess_1_1cached__node__allocator.html" title="Class template cached_node_allocator">cached_node_allocator</a> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>

  <span class="comment">// <a class="link" href="../boost_container_header_reference/classboost_1_1container_1_1allocator.html#id10-bb">public member functions</a></span>
  <a class="link" href="classboost_1_1interprocess_1_1cached__node__allocator.html#doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1cached__node__allocator_1a6d10e2d417d394b28d0a74c7f8944c52"><span class="identifier">cached_node_allocator</span></a><span class="special">(</span><span class="identifier">segment_manager</span> <span class="special">*</span><span class="special">)</span><span class="special">;</span>
  <a class="link" href="classboost_1_1interprocess_1_1cached__node__allocator.html#doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1cached__node__allocator_1a606cc696da45f1358b691e090febc7ab"><span class="identifier">cached_node_allocator</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="classboost_1_1interprocess_1_1cached__node__allocator.html" title="Class template cached_node_allocator">cached_node_allocator</a> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T2<span class="special">&gt;</span> 
    <a class="link" href="classboost_1_1interprocess_1_1cached__node__allocator.html#doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1cached__node__allocator_1aaa20034b350553e6b35757e9a48cf47a"><span class="identifier">cached_node_allocator</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="classboost_1_1interprocess_1_1cached__node__allocator.html" title="Class template cached_node_allocator">cached_node_allocator</a><span class="special">&lt;</span> <span class="identifier">T2</span><span class="special">,</span> <span class="identifier">SegmentManager</span><span class="special">,</span> <span class="identifier">NodesPerBlock</span> <span class="special">&gt;</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <a class="link" href="classboost_1_1interprocess_1_1cached__node__allocator.html#doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1cached__node__allocator_1aa468e042b99cf408636cc71c138863e0"><span class="special">~</span><span class="identifier">cached_node_allocator</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span>
  <span class="identifier">node_pool_t</span> <span class="special">*</span> <a class="link" href="classboost_1_1interprocess_1_1cached__node__allocator.html#doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1cached__node__allocator_1a0e5a9916cd5ca40351e8a0faccc189aa"><span class="identifier">get_node_pool</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="identifier">segment_manager</span> <span class="special">*</span> <a class="link" href="classboost_1_1interprocess_1_1cached__node__allocator.html#doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1cached__node__allocator_1aca25a6b8d75d1a4bd837284659f6caa1"><span class="identifier">get_segment_manager</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="identifier">size_type</span> <a class="link" href="classboost_1_1interprocess_1_1cached__node__allocator.html#doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1cached__node__allocator_1a8fbf927d9775ebd87825187d84374a8f"><span class="identifier">max_size</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="identifier">pointer</span> <a class="link" href="classboost_1_1interprocess_1_1cached__node__allocator.html#doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1cached__node__allocator_1af95b84363702ceb20c5e4a28f1e635e0"><span class="identifier">allocate</span></a><span class="special">(</span><span class="identifier">size_type</span><span class="special">,</span> <span class="identifier">cvoid_pointer</span> <span class="special">=</span> <span class="number">0</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">void</span> <a class="link" href="classboost_1_1interprocess_1_1cached__node__allocator.html#doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1cached__node__allocator_1a9c8ed8d6c785a73276e1d33184be5278"><span class="identifier">deallocate</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">pointer</span> <span class="special">&amp;</span><span class="special">,</span> <span class="identifier">size_type</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">void</span> <a class="link" href="classboost_1_1interprocess_1_1cached__node__allocator.html#doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1cached__node__allocator_1ab288f99a57d5f678ade9637bdbe030f8"><span class="identifier">deallocate_free_blocks</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span>
  <span class="identifier">pointer</span> <a class="link" href="classboost_1_1interprocess_1_1cached__node__allocator.html#doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1cached__node__allocator_1a8e3ab778c68b6bea06a211a7b0a59a67"><span class="identifier">address</span></a><span class="special">(</span><span class="identifier">reference</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="identifier">const_pointer</span> <a class="link" href="classboost_1_1interprocess_1_1cached__node__allocator.html#doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1cached__node__allocator_1aef28708ee6a78308a628b5675541c40c"><span class="identifier">address</span></a><span class="special">(</span><span class="identifier">const_reference</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="keyword">void</span> <a class="link" href="classboost_1_1interprocess_1_1cached__node__allocator.html#doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1cached__node__allocator_1a70a888654f52438b819616e589f614eb"><span class="identifier">construct</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">pointer</span> <span class="special">&amp;</span><span class="special">,</span> <span class="identifier">const_reference</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">void</span> <a class="link" href="classboost_1_1interprocess_1_1cached__node__allocator.html#doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1cached__node__allocator_1aaf1ca6e42e94305726cdbffbcaf9a2f6"><span class="identifier">destroy</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">pointer</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="identifier">size_type</span> <a class="link" href="classboost_1_1interprocess_1_1cached__node__allocator.html#doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1cached__node__allocator_1a018ee7b20938e86b4f0c58a976ff0b40"><span class="identifier">size</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">pointer</span> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="identifier">pointer</span> <a class="link" href="classboost_1_1interprocess_1_1cached__node__allocator.html#doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1cached__node__allocator_1a2df98f2624ae05113386fefa7bdcde54"><span class="identifier">allocation_command</span></a><span class="special">(</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">interprocess</span><span class="special">::</span><span class="identifier">allocation_type</span><span class="special">,</span> <span class="identifier">size_type</span><span class="special">,</span> 
                             <span class="identifier">size_type</span> <span class="special">&amp;</span><span class="special">,</span> <span class="identifier">pointer</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">void</span> <a class="link" href="classboost_1_1interprocess_1_1cached__node__allocator.html#doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1cached__node__allocator_1a0d46b959115292d1bdd702cdd5278af2"><span class="identifier">allocate_many</span></a><span class="special">(</span><span class="identifier">size_type</span><span class="special">,</span> <span class="identifier">size_type</span><span class="special">,</span> <span class="identifier">multiallocation_chain</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">void</span> <a class="link" href="classboost_1_1interprocess_1_1cached__node__allocator.html#doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1cached__node__allocator_1aaef029f3efed1c6d1c447a3294aa1961"><span class="identifier">allocate_many</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">size_type</span> <span class="special">*</span><span class="special">,</span> <span class="identifier">size_type</span><span class="special">,</span> <span class="identifier">multiallocation_chain</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">void</span> <a class="link" href="classboost_1_1interprocess_1_1cached__node__allocator.html#doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1cached__node__allocator_1abba37f9d9ac0ccd9c93f530c653d2f05"><span class="identifier">deallocate_many</span></a><span class="special">(</span><span class="identifier">multiallocation_chain</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="identifier">pointer</span> <a class="link" href="classboost_1_1interprocess_1_1cached__node__allocator.html#doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1cached__node__allocator_1a709c5765afc20c7d07da4762c3fa28d0"><span class="identifier">allocate_one</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span>
  <span class="identifier">multiallocation_chain</span> <a class="link" href="classboost_1_1interprocess_1_1cached__node__allocator.html#doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1cached__node__allocator_1adbf99c87abf0606764f3bb52536db237"><span class="identifier">allocate_individual</span></a><span class="special">(</span><span class="identifier">size_type</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">void</span> <a class="link" href="classboost_1_1interprocess_1_1cached__node__allocator.html#doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1cached__node__allocator_1a9979ca57ae2073d0b114bd54f2e970c4"><span class="identifier">deallocate_one</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">pointer</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">void</span> <a class="link" href="classboost_1_1interprocess_1_1cached__node__allocator.html#doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1cached__node__allocator_1a721575bacc33c14253ae1d7c4f0c5e18"><span class="identifier">deallocate_individual</span></a><span class="special">(</span><span class="identifier">multiallocation_chain</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">void</span> <a class="link" href="classboost_1_1interprocess_1_1cached__node__allocator.html#doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1cached__node__allocator_1a84d92ea7515fdb54740bd7f7f4a5025f"><span class="identifier">set_max_cached_nodes</span></a><span class="special">(</span><span class="identifier">size_type</span><span class="special">)</span><span class="special">;</span>
  <span class="identifier">size_type</span> <a class="link" href="classboost_1_1interprocess_1_1cached__node__allocator.html#doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1cached__node__allocator_1a3dd1b0e36c4f4007949b8f4bb108a746"><span class="identifier">get_max_cached_nodes</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>

  <span class="comment">// <a class="link" href="../boost_container_header_reference/structboost_1_1container_1_1allocator__traits.html#id11-bb">friend functions</a></span>
  <span class="keyword">void</span> <a class="link" href="classboost_1_1interprocess_1_1cached__node__allocator.html#doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1cached__node__allocator_1a63777ee47c37b3f6817aa6fc57db0e0d"><span class="identifier">swap</span></a><span class="special">(</span><span class="identifier">self_t</span> <span class="special">&amp;</span><span class="special">,</span> <span class="identifier">self_t</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
<span class="special">}</span><span class="special">;</span></pre></div>
<div class="refsect1">
<a name="id-1.3.16.19.3.5.4.4"></a><h2>Description</h2>
<div class="refsect2">
<a name="id-1.3.16.19.3.5.4.4.2"></a><h3>
<a name="id9-bb"></a><code class="computeroutput">cached_node_allocator</code> private member functions</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T2<span class="special">,</span> <span class="keyword">typename</span> SegmentManager2<span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> N2<span class="special">&gt;</span> 
  <a class="link" href="classboost_1_1interprocess_1_1cached__node__allocator.html" title="Class template cached_node_allocator">cached_node_allocator</a> <span class="special">&amp;</span> 
  <a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1cached__node__allocator_1a4183e4e6c9610222ead88c312202f8bf"></a><span class="keyword">operator</span><span class="special">=</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="classboost_1_1interprocess_1_1cached__node__allocator.html" title="Class template cached_node_allocator">cached_node_allocator</a><span class="special">&lt;</span> <span class="identifier">T2</span><span class="special">,</span> <span class="identifier">SegmentManager2</span><span class="special">,</span> <span class="identifier">N2</span> <span class="special">&gt;</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span></pre>
<p>Not assignable from related <a class="link" href="classboost_1_1interprocess_1_1cached__node__allocator.html" title="Class template cached_node_allocator">cached_node_allocator</a> </p>
</li>
<li class="listitem">
<pre class="literallayout"><a class="link" href="classboost_1_1interprocess_1_1cached__node__allocator.html" title="Class template cached_node_allocator">cached_node_allocator</a> <span class="special">&amp;</span> <a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1cached__node__allocator_1a948b3249fccec62371f2c488bd98da57"></a><span class="keyword">operator</span><span class="special">=</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="classboost_1_1interprocess_1_1cached__node__allocator.html" title="Class template cached_node_allocator">cached_node_allocator</a> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span></pre>
<p>Not assignable from other <a class="link" href="classboost_1_1interprocess_1_1cached__node__allocator.html" title="Class template cached_node_allocator">cached_node_allocator</a> </p>
</li>
</ol></div>
</div>
<div class="refsect2">
<a name="id-1.3.16.19.3.5.4.4.3"></a><h3>
<a name="id10-bb"></a><code class="computeroutput">cached_node_allocator</code> public member functions</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem">
<pre class="literallayout"><a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1cached__node__allocator_1a6d10e2d417d394b28d0a74c7f8944c52"></a><span class="identifier">cached_node_allocator</span><span class="special">(</span><span class="identifier">segment_manager</span> <span class="special">*</span> segment_mngr<span class="special">)</span><span class="special">;</span></pre>
<p>Constructor from a segment manager. If not present, constructs a node pool. Increments the reference count of the associated node pool. Can throw <a class="link" href="classboost_1_1interprocess_1_1bad__alloc.html" title="Class bad_alloc">boost::interprocess::bad_alloc</a> </p>
</li>
<li class="listitem">
<pre class="literallayout"><a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1cached__node__allocator_1a606cc696da45f1358b691e090febc7ab"></a><span class="identifier">cached_node_allocator</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="classboost_1_1interprocess_1_1cached__node__allocator.html" title="Class template cached_node_allocator">cached_node_allocator</a> <span class="special">&amp;</span> other<span class="special">)</span><span class="special">;</span></pre>
<p>Copy constructor from other <a class="link" href="classboost_1_1interprocess_1_1cached__node__allocator.html" title="Class template cached_node_allocator">cached_node_allocator</a>. Increments the reference count of the associated node pool. Never throws </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T2<span class="special">&gt;</span> 
  <a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1cached__node__allocator_1aaa20034b350553e6b35757e9a48cf47a"></a><span class="identifier">cached_node_allocator</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="classboost_1_1interprocess_1_1cached__node__allocator.html" title="Class template cached_node_allocator">cached_node_allocator</a><span class="special">&lt;</span> <span class="identifier">T2</span><span class="special">,</span> <span class="identifier">SegmentManager</span><span class="special">,</span> <span class="identifier">NodesPerBlock</span> <span class="special">&gt;</span> <span class="special">&amp;</span> other<span class="special">)</span><span class="special">;</span></pre>
<p>Copy constructor from related <a class="link" href="classboost_1_1interprocess_1_1cached__node__allocator.html" title="Class template cached_node_allocator">cached_node_allocator</a>. If not present, constructs a node pool. Increments the reference count of the associated node pool. Can throw <a class="link" href="classboost_1_1interprocess_1_1bad__alloc.html" title="Class bad_alloc">boost::interprocess::bad_alloc</a> </p>
</li>
<li class="listitem">
<pre class="literallayout"><a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1cached__node__allocator_1aa468e042b99cf408636cc71c138863e0"></a><span class="special">~</span><span class="identifier">cached_node_allocator</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre>
<p>Destructor, removes node_pool_t from memory if its reference count reaches to zero. Never throws </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">node_pool_t</span> <span class="special">*</span> <a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1cached__node__allocator_1a0e5a9916cd5ca40351e8a0faccc189aa"></a><span class="identifier">get_node_pool</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>
<p>Returns a pointer to the node pool. Never throws </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">segment_manager</span> <span class="special">*</span> <a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1cached__node__allocator_1aca25a6b8d75d1a4bd837284659f6caa1"></a><span class="identifier">get_segment_manager</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>
<p>Returns the segment manager. Never throws </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">size_type</span> <a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1cached__node__allocator_1a8fbf927d9775ebd87825187d84374a8f"></a><span class="identifier">max_size</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>
<p>Returns the number of elements that could be allocated. Never throws </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">pointer</span> <a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1cached__node__allocator_1af95b84363702ceb20c5e4a28f1e635e0"></a><span class="identifier">allocate</span><span class="special">(</span><span class="identifier">size_type</span> count<span class="special">,</span> <span class="identifier">cvoid_pointer</span> hint <span class="special">=</span> <span class="number">0</span><span class="special">)</span><span class="special">;</span></pre>
<p>Allocate memory for an array of count elements. Throws <a class="link" href="classboost_1_1interprocess_1_1bad__alloc.html" title="Class bad_alloc">boost::interprocess::bad_alloc</a> if there is no enough memory </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">void</span> <a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1cached__node__allocator_1a9c8ed8d6c785a73276e1d33184be5278"></a><span class="identifier">deallocate</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">pointer</span> <span class="special">&amp;</span> ptr<span class="special">,</span> <span class="identifier">size_type</span> count<span class="special">)</span><span class="special">;</span></pre>
<p>Deallocate allocated memory. Never throws </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">void</span> <a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1cached__node__allocator_1ab288f99a57d5f678ade9637bdbe030f8"></a><span class="identifier">deallocate_free_blocks</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre>
<p>Deallocates all free blocks of the pool </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">pointer</span> <a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1cached__node__allocator_1a8e3ab778c68b6bea06a211a7b0a59a67"></a><span class="identifier">address</span><span class="special">(</span><span class="identifier">reference</span> value<span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>
<p>Returns address of mutable object. Never throws </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">const_pointer</span> <a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1cached__node__allocator_1aef28708ee6a78308a628b5675541c40c"></a><span class="identifier">address</span><span class="special">(</span><span class="identifier">const_reference</span> value<span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>
<p>Returns address of non mutable object. Never throws </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">void</span> <a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1cached__node__allocator_1a70a888654f52438b819616e589f614eb"></a><span class="identifier">construct</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">pointer</span> <span class="special">&amp;</span> ptr<span class="special">,</span> <span class="identifier">const_reference</span> v<span class="special">)</span><span class="special">;</span></pre>
<p>Default construct an object. Throws if T's default constructor throws </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">void</span> <a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1cached__node__allocator_1aaf1ca6e42e94305726cdbffbcaf9a2f6"></a><span class="identifier">destroy</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">pointer</span> <span class="special">&amp;</span> ptr<span class="special">)</span><span class="special">;</span></pre>
<p>Destroys object. Throws if object's destructor throws </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">size_type</span> <a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1cached__node__allocator_1a018ee7b20938e86b4f0c58a976ff0b40"></a><span class="identifier">size</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">pointer</span> <span class="special">&amp;</span> p<span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>
<p>Returns maximum the number of objects the previously allocated memory pointed by p can hold. This size only works for memory allocated with allocate, allocation_command and allocate_many. </p>
</li>
<li class="listitem"><pre class="literallayout"><span class="identifier">pointer</span> <a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1cached__node__allocator_1a2df98f2624ae05113386fefa7bdcde54"></a><span class="identifier">allocation_command</span><span class="special">(</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">interprocess</span><span class="special">::</span><span class="identifier">allocation_type</span> command<span class="special">,</span> 
                           <span class="identifier">size_type</span> limit_size<span class="special">,</span> 
                           <span class="identifier">size_type</span> <span class="special">&amp;</span> prefer_in_recvd_out_size<span class="special">,</span> 
                           <span class="identifier">pointer</span> <span class="special">&amp;</span> reuse<span class="special">)</span><span class="special">;</span></pre></li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">void</span> <a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1cached__node__allocator_1a0d46b959115292d1bdd702cdd5278af2"></a><span class="identifier">allocate_many</span><span class="special">(</span><span class="identifier">size_type</span> elem_size<span class="special">,</span> <span class="identifier">size_type</span> num_elements<span class="special">,</span> 
                   <span class="identifier">multiallocation_chain</span> <span class="special">&amp;</span> chain<span class="special">)</span><span class="special">;</span></pre>
<p>Allocates many elements of size elem_size in a contiguous block of memory. The minimum number to be allocated is min_elements, the preferred and maximum number is preferred_elements. The number of actually allocated elements is will be assigned to received_size. The elements must be deallocated with deallocate(...) </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">void</span> <a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1cached__node__allocator_1aaef029f3efed1c6d1c447a3294aa1961"></a><span class="identifier">allocate_many</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">size_type</span> <span class="special">*</span> elem_sizes<span class="special">,</span> <span class="identifier">size_type</span> n_elements<span class="special">,</span> 
                   <span class="identifier">multiallocation_chain</span> <span class="special">&amp;</span> chain<span class="special">)</span><span class="special">;</span></pre>
<p>Allocates n_elements elements, each one of size elem_sizes[i]in a contiguous block of memory. The elements must be deallocated </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">void</span> <a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1cached__node__allocator_1abba37f9d9ac0ccd9c93f530c653d2f05"></a><span class="identifier">deallocate_many</span><span class="special">(</span><span class="identifier">multiallocation_chain</span> <span class="special">&amp;</span> chain<span class="special">)</span><span class="special">;</span></pre>
<p>Allocates many elements of size elem_size in a contiguous block of memory. The minimum number to be allocated is min_elements, the preferred and maximum number is preferred_elements. The number of actually allocated elements is will be assigned to received_size. The elements must be deallocated with deallocate(...) </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">pointer</span> <a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1cached__node__allocator_1a709c5765afc20c7d07da4762c3fa28d0"></a><span class="identifier">allocate_one</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre>
<p>Allocates just one object. Memory allocated with this function must be deallocated only with <a class="link" href="classboost_1_1interprocess_1_1cached__node__allocator.html#doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1cached__node__allocator_1a9979ca57ae2073d0b114bd54f2e970c4">deallocate_one()</a>. Throws <a class="link" href="classboost_1_1interprocess_1_1bad__alloc.html" title="Class bad_alloc">boost::interprocess::bad_alloc</a> if there is no enough memory </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">multiallocation_chain</span> <a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1cached__node__allocator_1adbf99c87abf0606764f3bb52536db237"></a><span class="identifier">allocate_individual</span><span class="special">(</span><span class="identifier">size_type</span> num_elements<span class="special">)</span><span class="special">;</span></pre>
<p>Allocates many elements of size == 1 in a contiguous block of memory. The minimum number to be allocated is min_elements, the preferred and maximum number is preferred_elements. The number of actually allocated elements is will be assigned to received_size. Memory allocated with this function must be deallocated only with <a class="link" href="classboost_1_1interprocess_1_1cached__node__allocator.html#doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1cached__node__allocator_1a9979ca57ae2073d0b114bd54f2e970c4">deallocate_one()</a>. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">void</span> <a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1cached__node__allocator_1a9979ca57ae2073d0b114bd54f2e970c4"></a><span class="identifier">deallocate_one</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">pointer</span> <span class="special">&amp;</span> p<span class="special">)</span><span class="special">;</span></pre>
<p>Deallocates memory previously allocated with <a class="link" href="classboost_1_1interprocess_1_1cached__node__allocator.html#doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1cached__node__allocator_1a709c5765afc20c7d07da4762c3fa28d0">allocate_one()</a>. You should never use deallocate_one to deallocate memory allocated with other functions different from <a class="link" href="classboost_1_1interprocess_1_1cached__node__allocator.html#doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1cached__node__allocator_1a709c5765afc20c7d07da4762c3fa28d0">allocate_one()</a>. Never throws </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">void</span> <a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1cached__node__allocator_1a721575bacc33c14253ae1d7c4f0c5e18"></a><span class="identifier">deallocate_individual</span><span class="special">(</span><span class="identifier">multiallocation_chain</span> it<span class="special">)</span><span class="special">;</span></pre>
<p>Allocates many elements of size == 1 in a contiguous block of memory. The minimum number to be allocated is min_elements, the preferred and maximum number is preferred_elements. The number of actually allocated elements is will be assigned to received_size. Memory allocated with this function must be deallocated only with <a class="link" href="classboost_1_1interprocess_1_1cached__node__allocator.html#doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1cached__node__allocator_1a9979ca57ae2073d0b114bd54f2e970c4">deallocate_one()</a>. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">void</span> <a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1cached__node__allocator_1a84d92ea7515fdb54740bd7f7f4a5025f"></a><span class="identifier">set_max_cached_nodes</span><span class="special">(</span><span class="identifier">size_type</span> newmax<span class="special">)</span><span class="special">;</span></pre>
<p>Sets the new max cached nodes value. This can provoke deallocations if "newmax" is less than current cached nodes. Never throws </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">size_type</span> <a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1cached__node__allocator_1a3dd1b0e36c4f4007949b8f4bb108a746"></a><span class="identifier">get_max_cached_nodes</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>
<p>Returns the max cached nodes parameter. Never throws </p>
</li>
</ol></div>
</div>
<div class="refsect2">
<a name="id-1.3.16.19.3.5.4.4.4"></a><h3>
<a name="id11-bb"></a><code class="computeroutput">cached_node_allocator</code> friend functions</h3>
<div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem">
<pre class="literallayout"><span class="keyword">void</span> <a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1cached__node__allocator_1a63777ee47c37b3f6817aa6fc57db0e0d"></a><span class="identifier">swap</span><span class="special">(</span><span class="identifier">self_t</span> <span class="special">&amp;</span> alloc1<span class="special">,</span> <span class="identifier">self_t</span> <span class="special">&amp;</span> alloc2<span class="special">)</span><span class="special">;</span></pre>
<p>Swaps allocators. Does not throw. If each allocator is placed in a different memory segment, the result is undefined. </p>
</li></ol></div>
</div>
</div>
</div>
<div class="copyright-footer">Copyright © 2005-2024 Ion Gaztanaga<p>
        Distributed under the Boost Software License, Version 1.0. (See accompanying
        file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
      </p>
</div>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="cached__adaptive__pool_8hpp_1a8538149c5beca8c76b5925eed81e4e0d.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../interprocess/indexes_reference.html#doxygen.boost_interprocess_header_reference.cached__node__allocator_8hpp"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="structboost_1_1interprocess_1_1cached__node__allocator_1_1rebind.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>
